package huoye.shops.guidance.adapter;

import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import huoye.shops.guidance.guide.GuideView;


public class GuidePagerAdapter extends PagerAdapter {

    private Context context;
    private GuideView[] views;
    public GuidePagerAdapter(Context context, GuideView[] views) {
        this.context = context;
        this.views =views;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        View view = views[position];
        container.addView(view);
        return view;
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView((View) object);
    }

    @Override
    public int getCount() {
        return views.length;
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view == object;
    }
}